package com.javen.service.impl;

import com.javen.dao.IUserDao;
import com.javen.model.User;
import com.javen.service.IUserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;


@Service("userService")
public class UserServiceImpl
        implements IUserService {
    @Resource
    private IUserDao userDao;

    public User getUserById(int userId) {
        return this.userDao.selectByPrimaryKey(Integer.valueOf(userId));
    }

    public User getUserByUserName(String username) {
        return this.userDao.selectByUserName(username);
    }

    public Integer insert(User record) {
        return Integer.valueOf(this.userDao.insert(record));
    }
}
